#!/usr/bin/env python3

import xlrd

CODE = 0  # 代码
NAME = 1  # 名称
INCRESE = 2  # 涨幅%
PRICE_BUY = 14  # 买价
PRICE_LOW = 15  # 最低
PRICE_HIGH = 16  # 最高
DECRESE = 18  # 涨跌
PRICE_TOTAL = 22  # 总金额
COUNT = 23  # 笔数

book = xlrd.open_workbook('/doc/Table2.xls')
sheet = book.sheet_by_index(0)
n = sheet.nrows

for i in range(n):
    row = sheet.row_values(i)
    print('{0:10} {1:6} {2:7} {3:10} {4:10} {5:10} {6:10} {7:10} {8:10}'.
          format(row[CODE], row[NAME], row[INCRESE], row[PRICE_BUY], row[
              PRICE_LOW], row[PRICE_HIGH], row[DECRESE], row[PRICE_TOTAL], row[
                  COUNT]))
